﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"
    >
    <Style TargetType="vc:Chart">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="vc:Chart" >
                    <Grid x:Name="RootElement" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Margin="0,0,0,0"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"
                          >

                        <Grid x:Name="ShadowGrid" Margin="0,0,0,0" Canvas.ZIndex="0" ></Grid>
                        
                        <Border x:Name="ChartBorder" Margin="0,0,0,0" Canvas.ZIndex="1" 
                                       Background="{TemplateBinding Background}"
                                       Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"
                                       BorderThickness="{TemplateBinding BorderThickness}" 
                                       CornerRadius="{TemplateBinding CornerRadius}"
                                       BorderBrush="{TemplateBinding BorderBrush}">
                      
                        <Grid x:Name="ChartAreaGrid" Canvas.ZIndex="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              Margin="{TemplateBinding Padding}" 
                              >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <Rectangle x:Name="ChartLightingBorder" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Grid.RowSpan="3" Visibility="Collapsed" Margin="0,0,0,0" Canvas.ZIndex="2" StrokeThickness="{TemplateBinding BorderThickness}" >
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#A0FFFFFF" Offset="0"/>
                                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>

                            <StackPanel x:Name="TopOuterPanel" Grid.Row="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Canvas.ZIndex="3">
                                <StackPanel x:Name="TopOuterTitlePanel" HorizontalAlignment="Stretch" >
                                       
                                </StackPanel>
                                <StackPanel x:Name="TopOuterLegendPanel" HorizontalAlignment="Stretch" ></StackPanel>
                            </StackPanel>

                            <StackPanel Name="BottomOuterPanel" Grid.Row="2" Grid.ColumnSpan="3" Canvas.ZIndex="3">
                                <StackPanel x:Name="BottomOuterLegendPanel" ></StackPanel>
                                <StackPanel x:Name="BottomOuterTitlePanel" ></StackPanel>
                            </StackPanel>

                            <StackPanel x:Name="LeftOuterPanel" Grid.Row="1" Grid.Column="0" Orientation="Horizontal"  Canvas.ZIndex="3">
                                <StackPanel x:Name="LeftOuterTitlePanel" Orientation="Horizontal" ></StackPanel>
                                <StackPanel x:Name="LeftOuterLegendPanel" Orientation="Horizontal" ></StackPanel>
                            </StackPanel>

                            <StackPanel x:Name="RightOuterPanel" Grid.Row="1" Grid.Column="2" Orientation="Horizontal"  Canvas.ZIndex="3">
                                <StackPanel x:Name="RightOuterLegendPanel" Orientation="Horizontal" ></StackPanel>
                                <StackPanel x:Name="RightOuterTitlePanel" Orientation="Horizontal" ></StackPanel>
                            </StackPanel>

                            <!-- -->
                            <Grid x:Name="CenterGrid" Grid.Row="1" Grid.Column="1" Canvas.ZIndex="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0">

                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <Grid x:Name="TopAxisGrid" Grid.Row="0" Grid.Column="1">
                                    <StackPanel x:Name="TopAxisContainer">
                                        <StackPanel x:Name="TopAxisPanel"></StackPanel>
                                        <ScrollBar x:Name="TopAxisScrollBar" Orientation="Horizontal" Visibility="Collapsed"></ScrollBar>
                                    </StackPanel>
                                </Grid>
                                <Grid x:Name="LeftAxisGrid" Grid.Row="1" Grid.Column="0" >
                                    <StackPanel x:Name="LeftAxisContainer" Orientation="Horizontal">
                                        <StackPanel x:Name="LeftAxisPanel"></StackPanel>
                                        <ScrollBar x:Name="LeftAxisScrollBar" Height="0" Orientation="Vertical" Visibility="Collapsed"></ScrollBar>
                                    </StackPanel>
                                </Grid>

                                <Grid x:Name="RightAxisGrid" Grid.Row="1"  Grid.Column="2" Width="Auto">
                                    <StackPanel x:Name="RightAxisContainer" Orientation="Horizontal" >
                                        <ScrollBar x:Name="RightAxisScrollBar" Height="0" Orientation="Vertical" Visibility="Collapsed" ></ScrollBar>
                                        <StackPanel x:Name="RightAxisPanel" ></StackPanel>
                                    </StackPanel>
                                </Grid>

                                <Grid x:Name="BottomAxisGrid"  Height="Auto" Grid.Row="2" Grid.Column="1">
                                    <StackPanel x:Name="BottomAxisContainer" >
                                        <ScrollBar  x:Name="BottomAxisScrollBar" Orientation="Horizontal" Visibility="Collapsed" ></ScrollBar>
                                        <StackPanel x:Name="BottomAxisPanel" ></StackPanel>
                                    </StackPanel>
                                </Grid>

                                <Grid x:Name="CenterInnerGrid" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                    
                                    <Grid  x:Name="PlotAreaGrid" Canvas.ZIndex="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0">
                                        <ScrollViewer BorderThickness="0"  x:Name="PlotAreaScrollViewer"  ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                                            <Canvas x:Name="PlotCanvas" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                
                                                <Canvas x:Name="PlotAreaShadowCanvas" Grid.Column="0" Grid.Row="0" Margin="0,0,0,0" Background="Green" VerticalAlignment="Top" Canvas.ZIndex="0"></Canvas>
                                                
                                                <Canvas x:Name="DrawingCanvas" Grid.Column="0" Grid.Row="0" Margin="0,0,0,0" Canvas.ZIndex="0"></Canvas>

                                                <Canvas x:Name="PlotAreaBevelCanvas" Grid.Column="0" Grid.Row="0"  Canvas.ZIndex="1"></Canvas>

                                            </Canvas>
                                        </ScrollViewer>
                                    </Grid>

                                    <Grid x:Name="InnerGrid"  Canvas.ZIndex="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>

                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <StackPanel Name="TopInnerPanel" Grid.Row="0" Grid.ColumnSpan="3">
                                            <StackPanel x:Name="TopInnerTitlePanel" ></StackPanel>
                                            <StackPanel x:Name="TopInnerLegendPanel" ></StackPanel>
                                        </StackPanel>

                                        <StackPanel Name="BottomInnerPanel" Grid.Row="2" Grid.ColumnSpan="3">
                                            <StackPanel x:Name="BottomInnerLegendPanel" ></StackPanel>
                                            <StackPanel x:Name="BottomInnerTitlePanel" ></StackPanel>
                                        </StackPanel>

                                        <StackPanel x:Name="LeftInnerPanel" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" >
                                            <StackPanel x:Name="LeftInnerTitlePanel" Orientation="Horizontal" ></StackPanel>
                                            <StackPanel x:Name="LeftInnerLegendPanel"  Orientation="Horizontal" ></StackPanel>
                                        </StackPanel>

                                        <StackPanel x:Name="RightInnerPanel" Grid.Column="2"  Grid.Row="1" Orientation="Horizontal" >
                                            <StackPanel x:Name="RightInnerLegendPanel" Orientation="Horizontal" ></StackPanel>
                                            <StackPanel x:Name="RightInnerTitlePanel" Orientation="Horizontal" ></StackPanel>
                                        </StackPanel>
                                    </Grid>
                                </Grid>
                            </Grid>
                           
                        </Grid>
                        </Border>
                        <Canvas x:Name="BevelCanvas" Canvas.ZIndex="2" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ></Canvas>
                        <StackPanel x:Name="CenterDockInsidePlotAreaPanel" Canvas.ZIndex="3" HorizontalAlignment="Center" VerticalAlignment="Center" ></StackPanel>
                        <StackPanel x:Name="CenterDockOutsidePlotAreaPanel" Canvas.ZIndex="4" HorizontalAlignment="Center" VerticalAlignment="Center" ></StackPanel>
                        <Canvas x:Name="ToolTipCanvas" Canvas.ZIndex="5" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" >
                            <Border x:Name="ToolTip" Visibility="Collapsed" HorizontalAlignment="Left" CornerRadius="4,4,4,4" BorderBrush="#FF000000" BorderThickness="0.25,0.25,0.25,1" Padding="10,5,10,5">
                                <Border.Background>
                                    <LinearGradientBrush Opacity=".999" EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFC8C8C4" Offset="0.156"/>
                                        <GradientStop Color="#F0FFFFFF" Offset="1"/>
                                    </LinearGradientBrush>

                                </Border.Background>
                                <Border.Child>
                                    <TextBlock x:Name="ToolTipTextBlock" Text="" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Verdana" FontSize="12" Foreground="#FF2E2D2D"/>
                                </Border.Child>
                            </Border>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Padding" Value="0"/>
        <Setter Property="AnimationType" Value="Type1"/>
        <Setter Property="AnimationDuration" Value="1.25"/>
        <Setter Property="AnimationEnabled" Value="true"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderThickness" Value="0.5"/>
        <Setter Property="BorderColor" Value="Black"/>
        <Setter Property="ColorSet" Value="Visifire1" />
        <Setter Property="Theme" Value="Theme1"/>
    </Style>

    <Style TargetType="vc:DataSeries">
        <Setter Property="Bevel" Value="true"/>
        <Setter Property="LightingEnabled" Value="true"/>
        <!--<Setter Property="MarkerBorderThickness" Value="1"/>-->
        <!--<Setter Property="MarkerScale" Value="1"/>-->
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderColor" Value="Black"/>
    </Style>

    <Style TargetType="vc:DataPoint">

    </Style>

    <Style TargetType="vc:Title">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="vc:Title" >
                    <Canvas Margin="0,0,0,0" ></Canvas>
                </ControlTemplate>
            </Setter.Value>

        </Setter>
        <Setter Property="Enabled" Value="True"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="FontColor" Value="Black"/>
    </Style>

    <Style TargetType="vc:Axis">
        <Setter Property="LineThickness" Value="0.5" />
        <Setter Property="LineColor" Value="Gray" />
        <Setter Property="TitleFontColor" Value="Black" />
        <!--<Setter Property="TitleFontSize" Value="11"/>-->
        <Setter Property="TitleFontFamily" Value="Verdana"/>
    </Style>

    <Style TargetType="vc:PlotArea">
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderColor" Value="Gray"/>
        <Setter Property="Color" Value="Transparent"/>
    </Style>

    <Style TargetType="vc:ChartGrid">
        <Setter Property="LineThickness" Value="0.25"/>
        <Setter Property="LineStyle" Value="Solid"/>
        <Setter Property="LineColor" Value="Gray"/>
    </Style>

    <Style TargetType="vc:AxisLabels">
        <Setter Property="FontSize" Value="10"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="FontColor" Value="Black"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontWeight" Value="Normal"/>
    </Style>

    <Style TargetType="vc:Ticks">
        <Setter Property="LineColor" Value="Gray"/>
        <Setter Property="LineThickness" Value="0.5"/>
        <Setter Property="LineStyle" Value="Solid"/>
        <Setter Property="Enabled" Value="true"/>
    </Style>

    <Style TargetType="vc:Legend">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="4"/>
        <Setter Property="EntryMargin" Value="3"/>
        <Setter Property="LabelMargin" Value="6"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontColor" Value="Black"/>
        <Setter Property="FontSize" Value="9"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderColor" Value="Black"/>
        <Setter Property="CornerRadius" Value="1"/>
        <Setter Property="Enabled" Value="true"/>
        <Setter Property="LightingEnabled" Value="true"/>
        <Setter Property="TitleFontSize" Value="10"/>
        <Setter Property="TitleBackground" Value="LightGray"/>
        <Setter Property="TitleAlignmentX" Value="Stretch"/>
        <Setter Property="TitleTextAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
    </Style>

</ResourceDictionary>